<?php 
	
	// ** Admin Settings ** //
     $settings = AdminSettings::first();
	 
	$trueProfile = true; 

?>

<?php $__env->startSection('title'); ?><?php echo Lang::get('users.lists_memberships'); ?> - <?php echo e( $user->name ); ?> - <?php $__env->stopSection(); ?>

 <?php echo $__env->make('includes.cover-static', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

<?php $__env->startSection('content'); ?> 

<!-- Col MD -->
<div class="col-md-8">	
			
<?php if( $totalGlobal != 0 ): ?>
	
	<h1 class="title-item none-overflow">
	<?php echo Lang::get('users.lists_memberships'); ?> <small>(<?php echo Helper::formatNumber( $totalGlobal ); ?>)</small>
	</h1> 
<hr />
	
	
	<?php foreach( $data as $lists ): ?>
	
	<?php
	
	if( Str::slug( $lists->name ) == '' ) {
	
		$slugUrl  = '';
	} else {
		$slugUrl  = '-'.Str::slug( $lists->name );
	}
	
	$slugUrlLists = URL::to('@').$lists->user()->username.'/lists/'.$lists->id.$slugUrl;
	 ?>
	 
<div class="media media-designer">
    		<span class="pull-left">
    			<a class="image-thumb" title="<?php echo e( $lists->user()->name ); ?>" href="<?php echo URL::to('@'); ?><?php echo $lists->user()->username; ?>">
    			<img width="45" height="45" class="media-object img-circle" src="<?php echo URL::asset('public/avatar'); ?>/<?php echo $lists->user()->avatar; ?>">
    			</a>
    		</span>
    		<div class="media-body">
    			<div class="pull-left">
    				<h4 class="media-heading">
    				<a class="link-user-profile" title="<?php echo e( $lists->name ); ?>" href="<?php echo $slugUrlLists; ?>">
    					<?php echo e( $lists->name ); ?></a> 
    			</h4>
    			 <!-- List group -->
    	<ul class="list-group list-designer">
    		<li><?php echo Lang::get('misc.by'); ?> 
    			<a class="links-ds" href="<?php echo URL::to('@'); ?><?php echo $lists->user()->username; ?>"><?php echo e( $lists->user()->name ); ?></a>
    			
    			// <a class="links-ds" href="<?php echo $slugUrlLists; ?>/members">
    			 			<strong><?php echo $lists->members()->count(); ?></strong> <?php echo Lang::choice('users.members',$lists->members()->count()); ?>

    			 			</a>
    			</li>
    			 </ul>
    			</div><!-- /End Pull Left -->
    			
	  <?php if( $lists->members()->count() != 0 ): ?> 	
	  <ul class="pull-right cover-img-desing list-inline" style="margin: 10px;">
	   <!-- Start List -->
	   <?php foreach( $lists->members()->take(5)->get() as $userlist ): ?>
	   <li>		    			
	    <a class="image-thumb" href="<?php echo URL::to('@'); ?><?php echo $userlist->user()->username; ?>">
	    			<img width="30" class="media-object img-circle showTooltip" data-toggle="tooltip" data-placement="left" title="<?php echo $userlist->user()->name; ?>"  src="<?php echo URL::asset('public/avatar'); ?>/<?php echo $userlist->user()->avatar; ?>">
	    			</a>
	   </li><!-- End List -->
	   <?php endforeach; ?>
	    	</ul>
	    	<?php endif; ?>
	 
	    	
  </div><!-- /End Media Body -->
</div><!-- Media Designer -->
<?php endforeach; ?>


<?php if( $data->getTotal() != $data->count() ): ?>
         	   
  <div class="btn-group paginator-style">
		   <?php echo $data->links(); ?> 
		</div>
		
<?php endif; ?>

				  	
	<?php else: ?>
	
	<?php if( Auth::check() && $user->id != Auth::user()->id || !Auth::check() ): ?>
	
	<div class="btn-block text-center">
	    	<i class="icon-list ico-no-result"></i>
	    </div>
	    
	<h3 class="margin-top-none text-center no-result user-no-result">
	    	- <strong><?php echo $user->name; ?></strong> <?php echo Lang::get('users.no_list_memberships'); ?> -
	    	</h3>
	    	
	    <?php elseif(Auth::check() && $user->id == Auth::user()->id): ?>	
	 
		<div class="btn-block text-center">
	    	<i class="icon-list ico-no-result"></i>
	    </div>
	    
	    <h3 class="margin-top-none text-center no-result user-no-result">
	    	- <?php echo Lang::get('users.session_no_list_member'); ?> -
	    	</h3>	

		<?php endif; ?>
	
	
	<?php endif; ?>
</div><!-- /COL MD -->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('sidebar'); ?>
	<div class="col-md-4">
		<?php echo $__env->make('includes.ads', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
	</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('javascript'); ?>
<?php echo HTML::script('public/js/count.js'); ?>

<script type="text/javascript">

<?php if(Session::has('success_add')): ?>
	 $('.popout').html("<?php echo Session::get('success_add'); ?>").fadeIn(500).delay(5000).fadeOut();
   <?php endif; ?>
   
   <?php if( Session::has('error_add') ): ?>
   	$('#myModal').modal('show');
   <?php endif; ?>

$("#updateShot").on('click',function(){
    	$(this).css({'display': 'none'})
    });
    
	$("#description").charCount({ allowed: <?php echo $settings->message_length; ?>, warning: 10, css: 'counterBio' });

</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>